﻿using EPiServer;
using EPiServer.DynamicContent;

namespace SocialPack.modules.SocialPack.DynamicContent.Facebook
{
    [DynamicContentPlugIn(
        DisplayName = "Facebook Live Stream",
        Description = "Displays Facebook Live Stream",
        ViewUrl = "~/modules/socialpack/dynamiccontent/facebook/livestream.ascx")]
    public partial class LiveStream : UserControlBase
    {
        public string CountryCode { get; set; }
        public int Width { get; set; }
        public int Height { get; set; }

        public string ApplicationId { get; set; }

        protected override void OnLoad(System.EventArgs e)
        {
            base.OnLoad(e);

            if (!string.IsNullOrWhiteSpace(this.CountryCode))
            {
                this.LiveStreamControl.CountryCode = this.CountryCode;
            }

            this.LiveStreamControl.Width = this.Width;
            this.LiveStreamControl.Height = this.Height;

            if (!string.IsNullOrWhiteSpace(this.ApplicationId))
            {
                this.LiveStreamControl.ApplicationId = this.ApplicationId;
            }
        }
    }
}